<%@ Page Language="VB" MasterPageFile="~/MasterPageExpandable.master" AutoEventWireup="false" CodeFile="Download.aspx.vb" Inherits="DataLoad_Download" title="CDM Data Load Tool - Download Page" %>

<%@ Register Src="DataLoadSubNavControl.ascx" TagName="DataLoadSubNavControl" TagPrefix="uc1" %>
<%@ Register Assembly="InputControls" Namespace="InputControls" TagPrefix="cc2" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<script language="javascript">
    function SelectAllCheckboxes(spanChk){

        var oItem = spanChk.children;
        var theBox = (spanChk.type=="checkbox")?spanChk:spanChk.children.item[0];

        xState = theBox.checked;
        elm = theBox.form.elements;

        for(i=0;i<elm.length;i++)

            if(elm[i].type=="checkbox" && elm[i].id!=theBox.id) {

                if(elm[i].checked!=xState)
                    elm[i].click();

            }

    }
    
    function alignDivs(scrollGridViewDiv, nameGridViewDiv, detailHeaderDiv)
    {
      //alert('b');
      var scrollDiv=document.getElementById(scrollGridViewDiv);
      var nameDiv=document.getElementById(nameGridViewDiv);
      var hdrDiv=document.getElementById(detailHeaderDiv);
      
      //alert(scrollDiv);
      //alert(nameDiv);
      //alert(hdrDiv);
      
      //alert('c');
      nameDiv.scrollTop=scrollDiv.scrollTop;
      hdrDiv.scrollLeft=scrollDiv.scrollLeft;
      //alert('d');
    }
    
</script>
 <uc1:DataLoadSubNavControl ID="DataLoadSubNavControl1" runat="server" />

<!-- div class="gridScrollContainer" style="overflow:scroll; width:960px; height:340px; left:0; margin-left:0;" -->  <!--onscroll="setTable removed -->
<h1><a id="pagecontent">Data Load Tool - Download Page</a></h1>
<table width="875px;" cellspacing="0" cellpadding="1">
  <tr>
  <td width="175" valign="top">
          <cc2:ScrollingGridView ID="ParticipantNameScrollingGridView" ToolTip="160" ShowFooter="false" IsFixedColumn="true" ShowScrollBars="false"  runat="server" Caption="Check the participants you want to download." CssClass="gridOffsetSmall" Width="185px" InnerDivWidth="345" AutoGenerateColumns="False" PageSize="40" AllowPaging="false" DataKeyNames="ParticipantId" CellPadding="5" CellSpacing="0" BorderColor="Gray" BorderStyle="Solid" GridLines="Vertical" EmptyDataText="No active participants are associated with you." AllowSorting="True">
              <HeaderStyle CssClass="adminHeaderStyle" Height="16" BackColor="#C3CAD4" BorderColor="#21334B" VerticalAlign="Top" />
        <RowStyle CssClass="adminColumnStyle" Height="32" />
          <Columns>
            <asp:TemplateField HeaderText="Download">
            <ItemStyle Width="55px" />
            <HeaderStyle Width="55px" />
             <HeaderTemplate>
                        Download
                    </HeaderTemplate>
            <ItemTemplate>
                <asp:CheckBox ID="downloadCheckBox" runat="server" />
            </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField HeaderText="Id" DataField="ParticipantId" ItemStyle-Width="50px" HeaderStyle-Width="50px" />
           <asp:BoundField HeaderText="First Name" DataField="FirstName" ItemStyle-Width="85px" HeaderStyle-Width="85px" />
           <asp:BoundField HeaderText="Last Name" DataField="LastName" ItemStyle-Width="110px" HeaderStyle-Width="110px" />
          </Columns>
          <AlternatingRowStyle BackColor="#E8ECF4" />
          <EmptyDataRowStyle CssClass="label" HorizontalAlign="Center" /></cc2:ScrollingGridView>
  </td>
  
  <td valign="top">
           <!-- <asp:Panel ID="GridPanel" Width="700" Height="340" ScrollBars="None" runat="server"> -->
           <!-- div style="overflow:auto; width:650px; left:0; margin-left:0;" -->
           <cc2:ScrollingGridView ID="ParticipantDetailsScrollingGridView" ToolTip="140" InnerDivWidth="580" IsFixedColumn="true" Caption="The columns marked (r) are read only to you; changes to them will not be saved." runat="server" CssClass="gridOffsetSmall" AutoGenerateColumns="False" PageSize="40" AllowPaging="false" DataKeyNames="ParticipantId,LegalGuardianId,ParticipantRepresentativeId" CellPadding="5" CellSpacing="0" BorderColor="Gray" BorderStyle="Solid" GridLines="Vertical" EmptyDataText="No active participants are associated with you." AllowSorting="True">
             <HeaderStyle CssClass="adminHeaderStyle" Height="16" BackColor="#C3CAD4" BorderColor="#21334B" VerticalAlign="Top" />
        <RowStyle CssClass="adminColumnStyle" Height="32"  />
            <AlternatingRowStyle BackColor="#E8ECF4" />
            <EmptyDataRowStyle CssClass="label" HorizontalAlign="Center" />
           </cc2:ScrollingGridView>
           
          <!-- </asp:Panel> -->
  </td>
  </tr>
</table>

<!-- /div -->

</asp:Content>
<asp:Content ID="FixedContent" runat="server" ContentPlaceHolderID="ContentPlaceHolder2">
   <table cellpadding="0" cellspacing="0">
   <tr>
   <td style="width:400px; text-align:left;">
   <asp:CheckBox  CssClass="adminHeaderStyle" ID="SelectAllCheckBox" Text="Set All" Font-Bold="true" TextAlign="Right" runat="server" onclick="javascript:SelectAllCheckboxes(this);"></asp:CheckBox>
   </td>
   <td>
   <asp:Button ID="DownloadButton" runat="server" Text="Download" />
   </td>
   </tr>
   </table>
 </asp:Content>
